package com.sky.mapper;

import com.sky.entity.AddressBook;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface AddressBookMapper {


    List<AddressBook> list(AddressBook addressBook);

    void insert(AddressBook addressBook);

    @Select("select * from address_book where id = #{id}")
    AddressBook select(Long id);

    void update(AddressBook addressBook);

    @Update("update address_book set is_default = #{isDefault} where user_id = #{userId}")
    void updateIsDefaultByUserId(AddressBook addressBook);

    @Delete("delete from address_book where id = #{id}")
    void delete(Long id);

}
